package com.java.common.constants;

import lombok.Getter;

/**
 * @author jiangli
 * @since 2019/6/24
 */
@Getter
public enum ResultCodeEnum {

	SUCCESS(true, 200,"成功"),
	UNKNOWN_REASON(false, 500, "未知异常，请联系管理员"),
	BAD_SQL_GRAMMAR(false, 501, "sql语法错误"),
	JSON_PARSE_ERROR(false, 502, "json解析异常"),
	PARAM_ERROR(false, 503, "参数不正确"),
	FILE_UPLOAD_ERROR(false, 504, "文件上传错误"),
	EXCEL_DATA_IMPORT_ERROR(false, 505, "Excel数据导入错误");

	/**
	 * 响应是否成功
	 */
	private Boolean success;
	/**
	 * 返回码
	 */
	private Integer code;
	/**
	 * 返回消息
	 */
	private String message;

	ResultCodeEnum(Boolean success, Integer code, String message) {
		this.success = success;
		this.code = code;
		this.message = message;
	}
}
